﻿<phone:PhoneApplicationPage
    x:Class="WP_Customer_ShopMob.Views.ArticlesPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot est la grille racine où tout le contenu de la page est placé-->
    <Grid x:Name="LayoutRoot" Background="Black">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contient le nom de l'application et le titre de la page-->
        <StackPanel Grid.Row="0" Margin="0,0,0,0" RenderTransformOrigin="0.502,0.508">
            <StackPanel Background="White" Margin="0,0,0,10" Height="111">
                <Image Source="/shopmob.png" Height="117" Margin="104,0" />
                <Rectangle Fill="#FF0A8DD8" HorizontalAlignment="Left" Height="6" Margin="-1,-10,0,0" Stroke="Transparent" VerticalAlignment="Top" Width="485"/>
            </StackPanel>

            <TextBlock Text="{Binding Nom}" Margin="10,0,0,0" Style="{StaticResource PhoneTextTitle1Style}" FontSize="60" FontFamily="Eras Demi ITC" Foreground="#FF0A8DD8" Height="83" HorizontalAlignment="Left" Width="470" RenderTransformOrigin="0.501,0.455"/>
        </StackPanel>
        
        <!--ContentPanel - placez tout contenu supplémentaire ici-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Controls:Pivot x:Name="pivot" Margin="0,-20,0,20" Foreground="#DEFDFDFD">
                <Controls:PivotItem Header="Détails" Margin="10,28,14,0">
                    <Controls:PivotItem.Background>
                        <ImageBrush Stretch="Fill"/>
                    </Controls:PivotItem.Background>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="221"></ColumnDefinition>
                            <ColumnDefinition Width="221"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="300"></RowDefinition>
                            <RowDefinition Height="110"></RowDefinition>
                        </Grid.RowDefinitions>
                        <ScrollViewer Grid.Column="0" HorizontalAlignment="Left" Height="300" VerticalAlignment="Top" Width="211">
                            <TextBlock Text="{Binding Details}"/>
                        </ScrollViewer>
                        <Slider x:Name="sld_qte" HorizontalAlignment="Left" Margin="143,10,0,0" Grid.Row="1" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="279" Maximum="100" SmallChange="1" LargeChange="1" ValueChanged="sld_qte_ValueChanged" Background="#DEFFFFFF" />
                        <TextBlock HorizontalAlignment="Left" Margin="10,25,0,0" Grid.Row="1" TextWrapping="Wrap" Text="Quantité :" VerticalAlignment="Top" RenderTransformOrigin="-0.306,-0.718"/>
                        <TextBlock Grid.Column="1" HorizontalAlignment="Left" Margin="26,10,0,0" TextWrapping="Wrap" Text="Prix :" VerticalAlignment="Top" RenderTransformOrigin="1.453,0.493"/>
                        <TextBlock Grid.Column="1" HorizontalAlignment="Left" Margin="85,10,0,0" TextWrapping="Wrap" Text="{Binding Prix}" VerticalAlignment="Top"/>
                        <TextBlock Grid.Column="1" HorizontalAlignment="Left" Margin="130,10,0,0" TextWrapping="Wrap" Text="€" VerticalAlignment="Top"/>
                        <TextBlock Text="{Binding Value, ElementName=sld_qte}" HorizontalAlignment="Left" Margin="101,25,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top"/>
                    </Grid>
                </Controls:PivotItem>
                <Controls:PivotItem Header="Magasins">
                    <ListBox Name="lst_magasin" ItemsSource="{Binding ListMagasins}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,5,0,5" Orientation="Horizontal">
                                    <TextBlock Text="{Binding ville}" />
                                    <TextBlock Text=" "/>
                                    <TextBlock Text="{Binding distance}" />
                                    <TextBlock Text="Kms"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Controls:PivotItem>
            </Controls:Pivot>
        </Grid>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton Click="btn_add_Click" Text="Ajouter" x:Name="btn_add" IconUri="/Assets/AppBar/appbar.add.rest.png"/>
            <shell:ApplicationBar.MenuItems>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>